package com.senken.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.senken.base.BaseController;
import com.senken.entity.ReturnChild;
import com.senken.service.IReturnChildService;

@Controller
@RequestMapping("/returnchild")
public class ReturnChildController extends BaseController{

	@Autowired
	private IReturnChildService returnChildService;
	
	@RequestMapping("/selectchild")
	@ResponseBody
	public List<ReturnChild> selectchild(int hid){
		return returnChildService.selectChild(hid);
	}
	
	@RequestMapping("/add")
	@ResponseBody
	public Object add(int ordernum,String devicecode,int num,String sales,String reason,int hid){
		System.out.println(ordernum);
		if(returnChildService.addReturnChild(ordernum, devicecode, num, sales, reason, hid)){
			return renderSuccess();
		}
		return renderError("系统错误");
	}
}
